var driver = require('../../dao/db');
var async = require('async');
var fs = require('fs');
var utils = require('../../dao/utils');

var deleteDB = function (data, _default) {

    var url = "mongodb://localhost:27017/manhua";
    var table = "manhua";


    var _query = {  "domain":"comic.kukudm.com" };


    async.waterfall([
        // 连接数据库        
        function (callback) {
            driver.connect(callback, url);
        },
        // 查找
        function (db, callback) {
            driver.deleteMany(db, callback, table, _query);
        },
        function (db, res, callback) {
            driver.close(db, res, callback);
        }
    ],
        // result
        function (err, result) {


            if (err) {
                console.log(err);
                return;
            }
            console.log('resulte');
            // console.log('find a new one '+data['title']+data['href']);

            // _default.successHandel(_default);
        }
    );
};


deleteDB();